<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
window.onload = function(){ 
	    var box = document.getElementById("box");			//获取<div id="box">
	    var width = box.style.getPropertyValue("width");		//读取div元素的width属性值
	    box.innerHTML =  "盒子宽度：" + width; 			//输出显示width值
}
</script>
</head>
<body>
<div id="box" style="width:300px; height:200px;border:solid 1px red" >盒子</div>
</body>
</html> 
